$(function () {
    let id =localStorage.getItem("UpRoleId");
    $.post("/Rolemenu.do/RolemenuAll", {roleid: id}, function (sdata) {
        console.log(sdata);
        $("[name='roleid']").val(id);
        $("[name='rolename']").val(id);
        let str = "";
        $.each(sdata, function (index, item) {
            str += " <div><input  type=\"checkbox\" "+(item.parentid!=0?'style=\'margin-left: 30px;\'':'')+" " + (item.tf == true ? 'checked' : '') + " id=\"checkbox\" value='" + item.menuid + "' name=\"menuid\">&nbsp;\n" +
                " <input type=\"button\"  value=\"" + item.menuname + "\" ></div>"
        });
        $("#AM").html(str);
    })
})

function submit() {
    $("#formyi").submit();
    localStorage.removeItem("UpRoleId");
}

function fh() {
    window.history.go(-1);
}